using System;
using System.Drawing.Imaging;
using System.Drawing;

namespace DFT.AJAX
{
    public partial class OrgChartImage : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            // Change the response headers to output a JPEG image.
            this.Response.Clear();
            this.Response.ContentType = "image/jpeg";
            Image OC = null;
            //Build the image 
            string imageName = Request.QueryString["ID"];
            if (Cache[imageName] != null)
            {
                OC = (Image)Cache[imageName];
                // Write the image to the response stream in JPEG format.
                OC.Save(this.Response.OutputStream, ImageFormat.Jpeg);
                OC.Dispose();
            }
        }
    }
}